from .sql import Sql
from dirbot.items import kaolaItem

class kaolaPipeline(object):

        #productName,url,picUrl,price,singlePrice,tag,commentCount
    def process_item(self,itemList,spider):
        for item in itemList:
            tag = ""
            if( item["tag"]!= None ):
                tag = item["tag"]
            Sql.insertKaolaRecoed(item["name"],item["url"],item["picUrl"],item["price"],"",tag,item["commentCount"])